
//
//  UImageView+Qiniu.swift
//  OneDay
//
//  Created by cheng xi on 2016/9/29.
//  Copyright © 2016年 xicheng. All rights reserved.
//

import UIKit


extension  UIImageView {

  func tx_setImageWithString(_ url:String?,isQiniuFlag:Bool = true){
    
//    if let nsURL = getUrlFromString(url,isQiniuFlag: isQiniuFlag) {
////      self.setImageWith(nsURL, placeholder: nil)
//      
//      TXLogDebug("加载图片：\(nsURL)")
//    }
  }
  
//  func tx_setImageWithString(_ url:String?,isQiniuFlag:Bool = true,placeholder:UIImage?,options:YYWebImageOptions,manager:YYWebImageManager,progress:@escaping YYWebImageProgressBlock,transform:@escaping YYWebImageTransformBlock,completion:@escaping YYWebImageCompletionBlock){
//    if let nsURL = getUrlFromString(url,isQiniuFlag: isQiniuFlag) {
//      self.setImageWith(nsURL, placeholder: placeholder, options: options, manager: manager, progress: progress, transform: transform, completion: completion)
//      TXLogDebug("\(#function)加载图片：\(nsURL)")
//
//    }
//  }
//  func tx_setImageWithString(_ url:String?,isQiniuFlag:Bool = true,placeholder:UIImage?,completion:@escaping YYWebImageCompletionBlock){
//    if let nsURL = getUrlFromString(url,isQiniuFlag: isQiniuFlag) {
//      
//      self.setImageWith(nsURL, placeholder: placeholder, options: YYWebImageOptions(rawValue: UInt(0)), completion: completion)
//      TXLogDebug("\(#function)加载图片：\(nsURL)")
//
//    }
//  }
//  
//  
//  func tx_setImageWithString(_ url:String?,isQiniuFlag:Bool = true,placeholder:UIImage?,options:YYWebImageOptions,completion:@escaping YYWebImageCompletionBlock){
//    if let nsURL = getUrlFromString(url,isQiniuFlag: isQiniuFlag) {
//      
//      self.setImageWith(nsURL, placeholder: placeholder, options: options, completion: completion)
//      TXLogDebug("\(#function)加载图片：\(nsURL)")
//
//    }
//  }
//  
//  func tx_setImageWithString(_ url:String?,isQiniuFlag:Bool = true,placeholder:UIImage?,options:YYWebImageOptions,progress:@escaping YYWebImageProgressBlock,transform:@escaping YYWebImageTransformBlock,completion:@escaping YYWebImageCompletionBlock){
//    if let nsURL = getUrlFromString(url,isQiniuFlag: isQiniuFlag) {
//      self.setImageWith(nsURL, placeholder: placeholder, options: options, progress: progress, transform: transform, completion: completion)
//      TXLogDebug("\(#function)加载图片：\(nsURL)")
//
//    }
//  }
//  
//  
//  fileprivate func getUrlFromString(_ url:String?,isQiniuFlag:Bool)->URL?{
//    
//    var resultURL:URL? = nil
//    if let u = url {
//      var urlStr:String = u
//      if !u.contains("http") {
//        urlStr = kQiNiuImagePrefix + urlStr
//      }
//      resultURL = URL(string: urlStr)
//    }
//    
//    if resultURL == nil {
//      self.image = nil
//    }
//    return resultURL
//  }
  
}
